package JAVA;

import java.util.Scanner;

public class work394 {
    public static void main(String[] args) {
        int classnum=3;
        int studentnum=4;
        double sum=0;
        double avg=0;
        Scanner input=new Scanner(System.in);
        for (int i=1;i<=classnum;i++){
            sum=0;
            System.out.println("请输入第"+i+"个班级的成绩");
            for (int j=1;j<=studentnum;j++){
                System.out.print("请输入第"+j+"个学生的成绩：");
                int score= input.nextInt();
                sum+=score;
            }
            avg=sum/studentnum;
            System.out.println("第"+i+"个班的平均成绩是："+avg);
        }
    }
}
